<% @edit_perm = has_permission?("Postgres:edit", @pg.ubid)
@delete_perm = has_permission?("Postgres:delete", @pg.ubid)
@page_title = @pg.name %>

<%== part(
  "components/page_header",
  title: "",
  breadcrumbs: [
    %w[Projects /project],
    [@project_data[:name], @project_data[:path]],
    ["PostgreSQL Databases", "#{@project_data[:path]}/postgres"],
    [@pg.name, "#"]
  ]
) %>

<main>
  <div class="flex rounded-lg bg-white shadow divide-x p-8">
    <div class="flex-none pr-8"><%== render("postgres/submenu") %></div>
    <div class="flex-auto pl-8">
      <div class="divide-y">
        <div class="pb-6 flex items-center justify-between">
          <div>
            <span class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:tracking-tight"><%= @pg.name %></span>
            <span>(id:
              <%= @pg.ubid %>)</span>
          </div>
          <div>
            <%== part("components/pg_state_label", state: @pg.display_state, extra_class: "text-md") %>
          </div>
        </div>
        <%== render("postgres/#{@page.tr("-", "_")}") %>
      </div>
    </div>
  </div>
</main>
